package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable1;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable1.UserBaseTable1DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable1.vo.*;

/**
 * 按揭房信贷 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable1Mapper extends BaseMapperX<UserBaseTable1DO> {

    default PageResult<UserBaseTable1DO> selectPage(UserBaseTable1PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable1DO>()
                .eqIfPresent(UserBaseTable1DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable1DO::getArea, reqVO.getArea())
                .eqIfPresent(UserBaseTable1DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable1DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable1DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable1DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .eqIfPresent(UserBaseTable1DO::getOneOrTwo, reqVO.getOneOrTwo())
                .betweenIfPresent(UserBaseTable1DO::getMortgageTime, reqVO.getMortgageTime())
                .eqIfPresent(UserBaseTable1DO::getLoanAmount, reqVO.getLoanAmount())
                .betweenIfPresent(UserBaseTable1DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable1DO::getId));
    }

    default List<UserBaseTable1DO> selectList(UserBaseTable1ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable1DO>()
                .eqIfPresent(UserBaseTable1DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable1DO::getArea, reqVO.getArea())
                .eqIfPresent(UserBaseTable1DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable1DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable1DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable1DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .eqIfPresent(UserBaseTable1DO::getOneOrTwo, reqVO.getOneOrTwo())
                .betweenIfPresent(UserBaseTable1DO::getMortgageTime, reqVO.getMortgageTime())
                .eqIfPresent(UserBaseTable1DO::getLoanAmount, reqVO.getLoanAmount())
                .betweenIfPresent(UserBaseTable1DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable1DO::getId));
    }

}
